package com.woniu.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Time;
import lombok.Data;

/**
 * 阶段计费表
 * @TableName stage_billing
 */
@TableName(value ="stage_billing")
@Data
public class StageBilling implements Serializable {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 时段类型
     */
    private String timeSlotType;

    /**
     * 开始时间
     */
    private Time startTime;

    /**
     * 结束时间
     */
    private Time endTime;

    /**
     * 时段电费
     */
    private BigDecimal electricityFee;

    /**
     * 充电服务费
     */
    private BigDecimal chargingServiceFee;

    /**
     * 计费规则表id
     */
    private Long billingRuleId;

    /**
     * 是否全时段
     */
    private Integer isAllDay;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        StageBilling other = (StageBilling) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTimeSlotType() == null ? other.getTimeSlotType() == null : this.getTimeSlotType().equals(other.getTimeSlotType()))
            && (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime()))
            && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()))
            && (this.getElectricityFee() == null ? other.getElectricityFee() == null : this.getElectricityFee().equals(other.getElectricityFee()))
            && (this.getChargingServiceFee() == null ? other.getChargingServiceFee() == null : this.getChargingServiceFee().equals(other.getChargingServiceFee()))
            && (this.getBillingRuleId() == null ? other.getBillingRuleId() == null : this.getBillingRuleId().equals(other.getBillingRuleId()))
            && (this.getIsAllDay() == null ? other.getIsAllDay() == null : this.getIsAllDay().equals(other.getIsAllDay()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTimeSlotType() == null) ? 0 : getTimeSlotType().hashCode());
        result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
        result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
        result = prime * result + ((getElectricityFee() == null) ? 0 : getElectricityFee().hashCode());
        result = prime * result + ((getChargingServiceFee() == null) ? 0 : getChargingServiceFee().hashCode());
        result = prime * result + ((getBillingRuleId() == null) ? 0 : getBillingRuleId().hashCode());
        result = prime * result + ((getIsAllDay() == null) ? 0 : getIsAllDay().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", timeSlotType=").append(timeSlotType);
        sb.append(", startTime=").append(startTime);
        sb.append(", endTime=").append(endTime);
        sb.append(", electricityFee=").append(electricityFee);
        sb.append(", chargingServiceFee=").append(chargingServiceFee);
        sb.append(", billingRuleId=").append(billingRuleId);
        sb.append(", isAllDay=").append(isAllDay);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}